home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-11-19 | 508 b | 25 lines | [TEXT/MPS ] |
- #
- # ChangeFileNames
- #
- # - changes the filename extension
- # of all files in the current directory
- #
- # - takes 2 arguments, the old and new extensions
- #
- # - commonly used to change ".FOR" to ".F"
- # (i.e. changefilenames for f)
- #
- # Example provided for owners of Language Systems FORTRAN
- # © 1990 Language Systems Corp.
- #
- if {#} < 2
- beep
- echo "usage: ChangeFileNames OldExt NewExt"
- exit 1
- end
-
- for name in `exists -f ≈"{1}"`
- (evaluate "{name}" =~ /(≈)®1"{1}"/) > dev:null
- rename "{name}" "{®1}{2}"
- end
-